#include "IDCard.h"
#include "IDCardFactory.h"
#include "Television.h"
#include "TelevisionFactory.h"

/* member function implementations of IDCard */
char* IDCard::IDCard::getOwner()
{
    return owner;
}

void IDCard::IDCard::use()
{
   std::cout << owner << " uses his/her idcard." << std::endl; 
}

/* member function implementations of IDCardFactory  */
const std::vector<char*>& IDCard::IDCardFactory::getOwners()
{
    return owners;
}

Framework::Product* IDCard::IDCardFactory::createProduct(char* o)
{
    return new IDCard(o);
}

void IDCard::IDCardFactory::registerProduct(Framework::Product& p)
{
    owners.push_back(((IDCard&)p).getOwner());
}

/* implememtations of namespace Television */
void Television::Television::use()
{
    std::cout << "this television has been turns on." << std::endl;
    std::cout << " - type: " << type << std::endl;
}

Framework::Product* Television::TelevisionFactory::createProduct(char* type)
{
    return new Television(type);
}

